#ifndef PLAYLIST_H
#define PLAYLIST_H

#include"player.h"
#include"progression.h"
#include"song.h"

#include<QList>
#include<QObject>
#include<QTimer>

class Playlist : public QObject
{
    Q_OBJECT
public:
    explicit Playlist(QObject *parent = 0);
    ~Playlist();

signals:
    void added(Song*, int);
    void playing(int);
    void playing(SongData*, int);
public slots:
    void add(const QString &location, int pos = -1);
    void add(const QUrl &location, int pos = -1);
    void add(Song *song, int pos = -1);

    void play();
    void pause();
    void next();
    void prev();
    void stop();

    void slotPlaying();
private slots:
    void releaseBlock();
private:
    Player *m_player;
    QList<Song*> m_songs;
    Progression *m_progression;
    QTimer *m_blockTimer;
    bool m_block;
};

#endif // PLAYLIST_H
